package com.share.wechat.core.service.impl;

import com.share.wechat.core.config.constant.CarouselConfig;
import com.share.wechat.core.entity.CarouselFigure;
import com.share.wechat.core.repository.inter.CarouselFigureRepository;
import com.share.wechat.core.service.CarouselFigureService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class CarouselFigureServiceImpl implements CarouselFigureService {
    private final Logger logger = Logger.getLogger(this.getClass());
    @Resource
    private CarouselFigureRepository carouselFigureRepository;
    @Override
    public List<CarouselFigure> getIndexCarousel() {
        List<CarouselFigure> resultList = carouselFigureRepository.findByDataSortAndIsOkOrderByUpdateTimeDesc(CarouselConfig.CAROUSEL_GROOM, CarouselConfig.VALID_TRUE);
        logger.debug("查询到的数据为"+resultList);
        return resultList;
    }
}
